package mc

import (
	"gitee.com/dreamwood/ez-go/db/mgo"
)

const (
	SellerBankCardEventNew           = "erp.SellerBankCardNew"
	SellerBankCardEventBeforeCreate  = "erp.SellerBankCardBeforeCreate"
	SellerBankCardEventBeforeUpdate  = "erp.SellerBankCardBeforeUpdate"
	SellerBankCardEventBeforeSave    = "erp.SellerBankCardBeforeCreate erp.SellerBankCardBeforeUpdate"
	SellerBankCardEventAfterCreate   = "erp.SellerBankCardAfterCreate"
	SellerBankCardEventAfterUpdate   = "erp.SellerBankCardAfterUpdate"
	SellerBankCardEventAfterSave     = "erp.SellerBankCardAfterCreate erp.SellerBankCardAfterUpdate"
	SellerBankCardEventDelete        = "erp.SellerBankCardDelete"
	SellerBankCardAccessControlEvent = "erp.SellerBankCardAccessControl"
)

func GetSellerBankCardConfig() *mgo.DocConfig {
	return SellerBankCard_Config
}

var SellerBankCard_Config *mgo.DocConfig

func init() {
	SellerBankCard_Config = NewSellerBankCardConfig()
}
func NewSellerBankCardConfig() *mgo.DocConfig {
	return &mgo.DocConfig{
		ContainerKey: "erp.SellerBankCard",
		Fields: []string{
			"seller", "name", "bank", "bankName", "card",
		},
		RelationFields: []string{
			"seller",
		},
		RelationConfigs: map[string]*mgo.DocRelation{
			"seller": {
				Config:     GetSellerConfig,
				DocName:    "Seller",
				JoinType:   "O",
				KeyInside:  "sellerId",
				KeyOutSide: "id",
			},
		},
		FieldFilter: map[string]*mgo.DocFieldFilter{
			"default": {
				Select: []string{},
				Omit:   []string{},
			},
		},
	}
}
